#!/bin/bash
DOCKER_VER=20.10.9
KUBEASZ_VER=3.2.0
K8S_BIN_VER=v1.23.1
EXT_BIN_VER=1.0.0
SYS_PKG_VER=0.4.2
HARBOR_VER=v2.1.3
REGISTRY_MIRROR=CN

calicoVer=v3.19.3
flannelVer=v0.15.1
dnsNodeCacheVer=1.21.1
corednsVer=1.8.6
dashboardVer=v2.4.0
dashboardMetricsScraperVer=v1.0.7
metricsVer=v0.5.2
pauseVer=3.6
nfsProvisionerVer=v4.0.2

export ciliumVer=v1.4.1
export kubeRouterVer=v0.3.1
export kubeOvnVer=v1.5.3
export promChartVer=12.10.6
export traefikChartVer=10.3.0

BASE="/etc/kubeasz"
imageDir="$BASE/down"

echo "$imageDir/calico_$calicoVer.tar" "calico/cni:$calicoVer" "calico/kube-controllers:$calicoVer" "calico/node:$calicoVer" "calico/pod2daemon-flexvol:$calicoVer"
echo "$imageDir/coredns_$corednsVer.tar" "coredns/coredns:$corednsVer"
echo "$imageDir/k8s-dns-node-cache_$dnsNodeCacheVer.tar" "easzlab/k8s-dns-node-cache:$dnsNodeCacheVer"
echo "$imageDir/dashboard_$dashboardVer.tar" "kubernetesui/dashboard:$dashboardVer"
echo "$imageDir/flannel_$flannelVer.tar" "easzlab/flannel:$flannelVer"
echo "$imageDir/metrics-scraper_$dashboardMetricsScraperVer.tar" "kubernetesui/metrics-scraper:$dashboardMetricsScraperVer"
echo "$imageDir/metrics-server_$metricsVer.tar" "easzlab/metrics-server:$metricsVer"
echo "$imageDir/pause_$pauseVer.tar" "easzlab/pause:$pauseVer"
echo "$imageDir/nfs-provisioner_$nfsProvisionerVer.tar" "easzlab/nfs-subdir-external-provisioner:$nfsProvisionerVer"
echo "$imageDir/kubeasz_$KUBEASZ_VER.tar" "easzlab/kubeasz:$KUBEASZ_VER"

docker load -i easzlab-kubeasz-k8s-bin-$K8S_BIN_VER.tar.gz
docker load -i easzlab-kubeasz-ext-bin-$EXT_BIN_VER.tar.gz
docker load -i easzlab-kubeasz-sys-pkg-$SYS_PKG_VER.tar.gz
docker load -i calico-cni-$calicoVer.tar.gz
docker load -i calico-pod2daemon-flexvol-$calicoVer.tar.gz
docker load -i calico-kube-controllers-$calicoVer.tar.gz
docker load -i calico-node-$calicoVer.tar.gz
docker load -i coredns-coredns-$corednsVer.tar.gz
docker load -i easzlab-k8s-dns-node-cache-$dnsNodeCacheVer.tar.gz
docker load -i kubernetesui-dashboard-$dashboardVer.tar.gz
docker load -i easzlab-flannel-$flannelVer.tar.gz
docker load -i kubernetesui-metrics-scraper-$dashboardMetricsScraperVer.tar.gz
docker load -i easzlab-metrics-server-$metricsVer.tar.gz
docker load -i easzlab-pause-$pauseVer.tar.gz
docker load -i easzlab-nfs-subdir-external-provisioner-$nfsProvisionerVer.tar.gz
docker load -i easzlab-kubeasz-$KUBEASZ_VER.tar.gz
